﻿Imports System.Collections.Generic
Imports System.Data
Imports System.Data.SqlClient


''' <summary>
''' Clase de la capa de acceso a datos DAL que implementa el patrón Table Data Gateway para el manejo de la entidad Idioma
''' </summary>
''' <remarks></remarks>
Public Class TDGIdioma

    Private Shared m_Instance As TDGIdioma = Nothing



    Public Function Find(conn As SqlConnection, Idi_Codigo As Int16) As SqlDataReader
        Dim command As New SqlCommand
        Dim dr As SqlDataReader


        command.Connection = conn
        command.CommandType = CommandType.StoredProcedure

        command.CommandText = "dbo.getIdioma"
        command.Parameters.AddWithValue("@Idi_Codigo", Idi_Codigo)


        dr = command.ExecuteReader()

        Return dr

    End Function

    Public Function FindAll(conn As SqlConnection) As SqlDataReader
        Dim command As New SqlCommand
        Dim dr As SqlDataReader

        command.Connection = conn
        command.CommandType = CommandType.StoredProcedure

        command.CommandText = "dbo.getIdioma_All"


        dr = command.ExecuteReader()

        Return dr

    End Function


    Public Shared ReadOnly Property Instance()
        Get
            If (m_Instance Is Nothing) Then
                m_Instance = New TDGIdioma()
            End If

            Return m_Instance
        End Get
    End Property

    Private Sub New()

    End Sub

End Class
